<html>
<head><meta charset="utf-8"><title>possible incorrect syntax highlighting · t-compiler/rust-analyzer · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/index.html">t-compiler/rust-analyzer</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/possible.20incorrect.20syntax.20highlighting.html">possible incorrect syntax highlighting</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="231334546"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/possible%20incorrect%20syntax%20highlighting/near/231334546" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Chetan Khilosiya <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/possible.20incorrect.20syntax.20highlighting.html#231334546">(Mar 22 2021 at 15:53)</a>:</h4>
<p>this is the case of highlighting variable name in function. When the variable name is same as function then the variable is highlighted as function with semantic token type <code>function</code>.<br>
Example: in rust-analyzer <code>highlight.rs</code> file line number 33. element is name of function and variable also.</p>



<a name="231334634"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/possible%20incorrect%20syntax%20highlighting/near/231334634" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Chetan Khilosiya <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/possible.20incorrect.20syntax.20highlighting.html#231334634">(Mar 22 2021 at 15:53)</a>:</h4>
<p>Is this known or some special case I don't know?</p>



<a name="231336566"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/possible%20incorrect%20syntax%20highlighting/near/231336566" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/possible.20incorrect.20syntax.20highlighting.html#231336566">(Mar 22 2021 at 16:03)</a>:</h4>
<p>You can file an issue so we don't forget about it</p>



<a name="231336793"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/possible%20incorrect%20syntax%20highlighting/near/231336793" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lukas Wirth <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/possible.20incorrect.20syntax.20highlighting.html#231336793">(Mar 22 2021 at 16:04)</a>:</h4>
<p>Thats known but we havent made an issue about it yet i think</p>



<a name="231336981"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/possible%20incorrect%20syntax%20highlighting/near/231336981" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lukas Wirth <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/possible.20incorrect.20syntax.20highlighting.html#231336981">(Mar 22 2021 at 16:05)</a>:</h4>
<p><a href="#narrow/stream/185405-t-compiler.2Fwg-rls-2.2E0/topic/Cross.20crate.20find.20usages.20seems.20to.20be.20broken.3F/near/229489409">https://rust-lang.zulipchat.com/#narrow/stream/185405-t-compiler.2Fwg-rls-2.2E0/topic/Cross.20crate.20find.20usages.20seems.20to.20be.20broken.3F/near/229489409</a></p>



<a name="231337785"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/possible%20incorrect%20syntax%20highlighting/near/231337785" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Chetan Khilosiya <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/possible.20incorrect.20syntax.20highlighting.html#231337785">(Mar 22 2021 at 16:09)</a>:</h4>
<p><span class="user-mention silent" data-user-id="203546">Laurențiu Nicola</span> <a href="#narrow/stream/185405-t-compiler.2Fwg-rls-2.2E0/topic/possible.20incorrect.20syntax.20highlighting/near/231336566">said</a>:</p>
<blockquote>
<p>You can file an issue so we don't forget about it</p>
</blockquote>
<p>Sure I will file issue.</p>



<a name="231339464"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/possible%20incorrect%20syntax%20highlighting/near/231339464" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Chetan Khilosiya <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/possible.20incorrect.20syntax.20highlighting.html#231339464">(Mar 22 2021 at 16:17)</a>:</h4>
<p>Created issue: <a href="https://github.com/rust-analyzer/rust-analyzer/issues/8152">https://github.com/rust-analyzer/rust-analyzer/issues/8152</a></p>



<a name="231339647"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/possible%20incorrect%20syntax%20highlighting/near/231339647" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Chetan Khilosiya <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/possible.20incorrect.20syntax.20highlighting.html#231339647">(Mar 22 2021 at 16:18)</a>:</h4>
<p>I am trying to implement to apply trait modifier to function names and refs. How to know when function is trait function or not?</p>



<a name="231339715"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/possible%20incorrect%20syntax%20highlighting/near/231339715" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Chetan Khilosiya <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/possible.20incorrect.20syntax.20highlighting.html#231339715">(Mar 22 2021 at 16:19)</a>:</h4>
<p>I can't find anything related in semantics.</p>



<a name="231340683"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/possible%20incorrect%20syntax%20highlighting/near/231340683" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lukas Wirth <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/possible.20incorrect.20syntax.20highlighting.html#231340683">(Mar 22 2021 at 16:24)</a>:</h4>
<p>You can use <code>AsAssocItem</code> to get the function/const/type alias as an associated item <a href="https://github.com/rust-analyzer/rust-analyzer/blob/94aa3a7b1af7b756139e6c2d8384beb57daa6190/crates/hir/src/lib.rs#L1176-L1179">https://github.com/rust-analyzer/rust-analyzer/blob/94aa3a7b1af7b756139e6c2d8384beb57daa6190/crates/hir/src/lib.rs#L1176-L1179</a></p>



<a name="231340967"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/possible%20incorrect%20syntax%20highlighting/near/231340967" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lukas Wirth <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/possible.20incorrect.20syntax.20highlighting.html#231340967">(Mar 22 2021 at 16:25)</a>:</h4>
<p><code>AssocItem</code> then has a <code>container</code> method you can use to check where the assoc item comes from</p>



<a name="231340973"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/possible%20incorrect%20syntax%20highlighting/near/231340973" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Chetan Khilosiya <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/possible.20incorrect.20syntax.20highlighting.html#231340973">(Mar 22 2021 at 16:25)</a>:</h4>
<p>what is the meaning of assoc items in rust?</p>



<a name="231341141"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/possible%20incorrect%20syntax%20highlighting/near/231341141" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/possible.20incorrect.20syntax.20highlighting.html#231341141">(Mar 22 2021 at 16:26)</a>:</h4>
<p><a href="https://doc.rust-lang.org/reference/items/associated-items.html">https://doc.rust-lang.org/reference/items/associated-items.html</a></p>



<a name="231341161"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/possible%20incorrect%20syntax%20highlighting/near/231341161" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lukas Wirth <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/possible.20incorrect.20syntax.20highlighting.html#231341161">(Mar 22 2021 at 16:26)</a>:</h4>
<p>Associated items are functions, type aliases and consts that are defined in an <code>impl</code> block/ trait</p>



<a name="231341412"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/possible%20incorrect%20syntax%20highlighting/near/231341412" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Chetan Khilosiya <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/possible.20incorrect.20syntax.20highlighting.html#231341412">(Mar 22 2021 at 16:28)</a>:</h4>
<p>this definition I have known. but I am not able to link how it is internally provide me details of function. I will study the implementation in RA.</p>



<a name="231341494"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/possible%20incorrect%20syntax%20highlighting/near/231341494" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Chetan Khilosiya <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/possible.20incorrect.20syntax.20highlighting.html#231341494">(Mar 22 2021 at 16:28)</a>:</h4>
<p>Thank you for the pointers. :)</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>